package com.wesley.strategy;

/**
 * @author:wesley
 */
public class Apple implements FruitPrice {

    private Double price;

    private PriceStrategy ps;

    public void setPrice(Double price) {
        this.price = price;
    }

    public PriceStrategy getPs() {
        return ps;
    }

    public void setPs(PriceStrategy ps) {
        this.ps = ps;
    }

    public Apple(Double price, PriceStrategy ps) {
        this.price = price;
        this.ps = ps;
    }

    public Double getPrice() {
        return price;
    }

    @Override
    public double getRealPrice() {
        return this.price * ps.getRatio();
    }
}
